CX_FORMULA_ATTRIBUTES
Class hierarchy
- CX_CLASS
- CX_SIMPLE
- CX_TERMED
- CX_EXPANDABLE
- CX_ATTRIBUTE
- CX_SLOT_ATTRIBUTES
- CX_FORMULA_ATTRIBUTES
- CX_SLOT_ATTRIBUTES
- CX_ATTRIBUTE
- CX_EXPANDABLE
- CX_TERMED
- CX_SIMPLE
Description:
A calculated attribute allows the contents of a slot to be filled by a formula. It also provides a more detailed description of this field.
An example of this is the definition of an article "carpet", which, in addition to a length and width specification, contains the data field "carpet size", which is calculated from the first two sizes according to the formula "area = length x width". This formula is stored once in the system and can be used in a specific context by means of a formula attribute.
Example: Different area specifications (e.g. carpet size and floor space) based on a slot area which contains the formula "area = length x width
A CX_FORMULA_ATTRIBUTE can be given the parameters for its own formula, e.g. sub-formulae such as (l=) a + 5, where a is a slot in the CX_FORMULA_ATTRIBUTE. a could therefore be a conditioned bag itself: attribute area = attribute length * attribute width
Code example:
// Create the formula attribute with formula: volume=width*height*depth Var(formulaAttribute, formula) CreateTransObject(CX_FORMULA_ATTRIBUTE) -> formulaAttribute CreateTransObject(CX_FORMULA) -> formula "width*height*depth" // = volume formula Put "volume" formulaAttribute Put(NameMA()) // which slot should be calculated? formula formulaAttribute Link(formula) // how should the slot's value be calculated? // Wrap our formula attribute inside an attribute set Var(attributeSet) CreateTransObject(CX_ATTRIBUTE_SET) -> attributeSet formulaAttribute attributeSet Link(attributes) // Create the item to calculate the attribute for Var(item) CreateTransObject(CX_ITEM) -> item attributeSet item Link(attributeSet) // add our formula attribute to this item // Fill the dependent variables (slots) 10m item Put(width) 5m item Put(height) 5cm item Put(depth) // Put the item itself into the plug space (formula variables are searched in the plug space) // and calculate the volume based on the above properties. [ item ] PlugSpace item Copy(volume) // -> 2500 l
Function | MA* | Parameters | Return | Brief description |
---|---|---|---|---|
IsValueAttribute | INTEGER | Is this attribute a preset attribute? | ||
GetInputAccessPaths 233188 | VECTOR<STRING> | Determine the access paths that occur in the formula. | ||
GetInputVarNames | (OBJECT.) | VECTOR<STRING> | Determine the slots that occur in the formula. | |
SanityCheck | INTEGER | Check for consistency of the object | ||
AttributeDescription | * | |||
AttributeID | STRING | |||
CalculationSubterms | VECTOR | Determining the slot names that occur in a formula | ||
CheckValue | INTEGER | |||
ClassFilter | STRING, INTEGER | OBJECT | This object, if it corresponds to a certain class | |
ConditionedFilter | STRING | OBJECT | ||
ConditionedFilter2 | OBJECT | OBJECT | ||
ConvertObject | OBJECT | ANY | converts the transferred object into a value that corresponds to the type of the attribute; in the case of a result of the type CX_NUMERIC and derived, the decimal places are taken from the attribute value | |
CreatePersistentTable | OBJECT | creates a table for enumerations or discrete values and connects it to the attribute object | ||
Deleted | INTEGER | Object marked as deleted? | ||
| deletes a table linked to the attribute for | |||
| STRING | Name of this object | ||
| OBJECT | OBJECT | ||
| INTEGER | Domain of this object | ||
GetSiblings | COLLECTION | All siblings of this object | ||
GetSiblings2 | COLLECTION | All siblings of this object | ||
GetSlotEntries | VECTOR<object>VECTOR<object></ob | Return of internal information about slots | ||
GetValue | STRING, STRING, INTEGER | OBJECT | Dummy function | |
HasConstraint | * | Validity available? | ||
LastUpdate | OBJECT | Date of the last write access | ||
LastUser | INTEGERINTEGER | User who last had write access to the object | ||
LimitedValuesMA | * | |||
link | OBJECT | Add this object to the list of objects with validity | ||
Name | STRING | Name of the slot that the attribute explains | ||
NameMA | * | Name or (internal) number of the slot that the attribute explains in more detail | ||
NextValidObject | OBJECT | Subsequent validity object in time | ||
NullValue | ANY | Null value of the type of the attribute value | ||
PreviousValidObject | OBJECT | Previous validity object in time | ||
RefTypeID | INTEGERINTEGER | |||
RestrictedValidity | * | Area of validity limited? | ||
SetDomain | INTEGERINTEGER, INTEGER | Set domain | ||
ShortName | STRING | Short name of this object | ||
Siblings | * | Objects with validity | ||
SpanDateValidity | * | Period of validity | ||
SpecifierID | STRING | |||
Type | STRING | Return of the data type held in the slot | ||
TypeID | INTEGERINTEGER | Returns the ID number of the data type held in the slot | ||
string | INTEGERINTEGER | CX_STRING | Returns the string representation of the object | |
UnconditionalValue | * | Value of the slot, constraints are not considered | ||
UnconditionalValueObject | ANY | Value of the slot, constraints are not considered | ||
UniqueID | STRING | Content of the fixed data field "uniqueID | ||
Unlink | Remove this object from the list of objects with validity | |||
Unlink2 | Remove this object from the list of objects with validity | |||
Valid | OBJECT | INTEGERINTEGER | Check validity | |
ValidSince | OBJECT | Start of validity period | ||
ValidToday | INTEGERINTEGER | Valid today? | ||
ValidUntil | OBJECT | End of validity period | ||
Value | * | Value of the slot, when the slot is issued, the calculated value is tested against constraints | ||
Value Export | INTEGERINTEGER | STRING | Value of the slot, formatted as string | |
ValueObject | ANY | Value of the slot, the calculated value tested against constraints | ||
VerifySiblings | INTEGERINTEGER | Check ring of exchange objects |
* MA = Member Access function,
grey background = inherited function
Data field | Type | Reference class | I* | Brief description |
---|---|---|---|---|
formula | POINTER | CX_FORMULA | The formula | |
attribute | INTEGERINTEGER | The (internal) number of the slot that the attribute explains in more detail | ||
attributeEnum | ENUMSHORT | Type | ||
constraint | POINTER | CX_FORMULA | Validity | |
uniqueID | STRING | * | Unique key | |
validity | POINTER | CX_VALIDITY | Validity period of the object |
* I = Indexable data field,
grey background = inherited data field
Module | Brief description |
---|---|
attrfedt.mod | Calculated features Editing module |